

import edu.ksu.cis.bandera.tool.Tool;
import edu.ksu.cis.bandera.tool.ToolConfigurationView;
import edu.ksu.cis.bandera.tool.ToolIconView;
import edu.ksu.cis.bandera.util.BaseObservable;
import edu.ksu.cis.projects.bogor.Bogor;
import edu.ksu.cis.projects.bogor.DefaultBogorConfiguration;
import edu.ksu.cis.projects.bogor.IBogorConfiguration;
import edu.ksu.cis.projects.bogor.ast.System;
import edu.ksu.cis.projects.bogor.ast.checker.Checker;
import edu.ksu.cis.projects.bogor.module.IMessageStore;
import edu.ksu.cis.projects.bogor.module.IProgressManager;
import edu.ksu.cis.projects.bogor.module.ISearcher;
import edu.ksu.cis.projects.bogor.module.metrics.DoubleReportValue;
import edu.ksu.cis.projects.bogor.module.metrics.FloatReportValue;
import edu.ksu.cis.projects.bogor.module.metrics.IntReportValue;
import edu.ksu.cis.projects.bogor.module.metrics.LongReportValue;
import edu.ksu.cis.projects.bogor.module.metrics.ReportValue;
import edu.ksu.cis.projects.bogor.module.metrics.StringReportValue;
import edu.ksu.cis.projects.bogor.symboltable.SymbolTable;
import edu.ksu.cis.projects.bogor.tool.results.errors.v1.CheckerFailure;
import edu.ksu.cis.projects.bogor.tool.results.errors.v1.Errors;
import edu.ksu.cis.projects.bogor.tool.results.errors.v1.ModelFailure;
import edu.ksu.cis.projects.bogor.tool.results.errors.v1.PropertyFailure;
import edu.ksu.cis.projects.bogor.tool.results.errors.v1.types.CheckerFailureTypes;
import edu.ksu.cis.projects.bogor.tool.results.errors.v1.types.ModelFailureTypes;
import edu.ksu.cis.projects.bogor.tool.results.errors.v1.types.PropertyFailureTypes;
import edu.ksu.cis.projects.bogor.tool.results.files.v1.Files;
import edu.ksu.cis.projects.bogor.tool.results.files.v1.types.FileTypes;
import edu.ksu.cis.projects.bogor.tool.results.metrics.Metric;
import edu.ksu.cis.projects.bogor.tool.results.metrics.Metrics;
import edu.ksu.cis.projects.bogor.util.FileMessage;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;
import java.io.ObjectOutputStream;
import java.io.OutputStream;
import java.io.PrintWriter;
import java.io.StringWriter;
import java.util.ArrayList;
import java.util.Collection;
import java.util.HashMap;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
import java.util.Properties;
import java.util.Set;

public class BogorTool2 extends BaseObservable
  implements Tool
{
  private static final String TRAIL_FILE_PREFIX_KEY = "edu.ksu.cis.projects.bogor.tool.trailFilePrefix";
  private static final String DUMP_CONFIGURATION_FLAG_KEY = "edu.ksu.cis.projects.bogor.tool.dumpConfiguration";
  private static final String CONFIGURATION_FILE_NAME_KEY = "edu.ksu.cis.projects.bogor.tool.dumpConfigurationFileName";
  private static final String DATA_MAP_FILE_NAME_KEY = "edu.ksu.cis.projects.bogor.tool.dumpDataMapFileName";
  private boolean stopped;
  private IBogorConfiguration bogorConfiguration;
  private Map<String, Object> externalDataMap;
  private String externalDataMapFileName;
  private static final String DEFAULT_DATA_MAP_FILE_NAME = "externalDataMap.object";
  private static final String DEFAULT_CONFIGURATION_FILE_NAME = "bandera.bogor-conf";
  public static final String MODEL_INPUT_PARAMETER = "Model";
  public static final String CONFIG_INPUT_PARAMETER = "Config";
  public static final String EXTERNAL_DATA_INPUT_PARAMETER = "ExternalDataMap";
  public static final String STATES_METRIC_KEY = "States";
  public static final String MATCHED_STATES_METRIC_KEY = "MatchedStates";
  public static final String MAX_DEPTH_METRIC_KEY = "MaxDepth";
  public static final String TRANSITIONS_METRIC_KEY = "Transitions";
  public static final String RESULT_OUTPUT_PARAMETER = "Result";
  public static final String PRINT_OUTPUT_PARAMETER = "Print";
  public static final String FILES_OUTPUT_PARAMETER = "Files";
  public static final String ERRORS_OUTPUT_PARAMETER = "Errors";
  public static final String METRICS_OUTPUT_PARAMETER = "Metrics";
  public static final String VERIFIED_RESULT_KEY = "Verified";
  public static final String TYPE_CHECKED_RESULT_KEY = "TypeChecked";
  public static final String ERRORS_RESULT_KEY = "Errors";
  public static final String WARNINGS_RESULT_KEY = "Warnings";
  public static final String STOPPED_RESULT_KEY = "Stopped";
  public static final String[] inputParameters;
  public static String[] outputParameters;
  private String configurationFileName;
  private boolean dumpConfiguration;
  private String trailFilePrefix;
  protected System model;
  protected Properties defaultConfiguration;
  protected Properties toolConfiguration;
  protected Properties inputConfiguration;
  protected PrintWriter pw;
  protected Map<Object, Object> outputMap;
  private Errors errors;
  private Files files;
  private IProgressManager progressManager;

  public BogorTool2()
  {
    this.dumpConfiguration = false;

    this.defaultConfiguration = loadDefaultConfiguration();
    this.externalDataMap = new HashMap();
    this.externalDataMapFileName = "externalDataMap.object";
    this.outputMap = new HashMap(0);
    initBogorConfiguration();
    initProgressManager();
  }

  private Properties loadDefaultConfiguration()
  {
    Properties defaultConfiguration = new Properties();
    try
    {
      defaultConfiguration.load(BogorTool2.class.getResourceAsStream("default.bogor-conf"));
    } catch (IOException e) {
      throw new RuntimeException(e);
    }

    return defaultConfiguration;
  }

  public void setConfiguration(String configurationString)
    throws IOException
  {
    if (this.toolConfiguration == null)
      this.toolConfiguration = new Properties();
    else {
      this.toolConfiguration.clear();
    }

    if ((configurationString == null) || ("".equals(configurationString)))
    {
      return;
    }

    ByteArrayInputStream bais = new ByteArrayInputStream(configurationString.getBytes());
    this.toolConfiguration.load(bais);
    bais.close();

    fixProperties(this.toolConfiguration);

    String dumpConfigurationString = this.toolConfiguration.getProperty("edu.ksu.cis.projects.bogor.tool.dumpConfiguration");
    if (dumpConfigurationString != null)
    {
      if (dumpConfigurationString.trim().toLowerCase().equals("true"))
        this.dumpConfiguration = true;
      else {
        this.dumpConfiguration = false;
      }
    }
    this.configurationFileName = this.toolConfiguration.getProperty("edu.ksu.cis.projects.bogor.tool.dumpConfigurationFileName");
    if ((this.configurationFileName == null) || (this.configurationFileName.length() <= 0)) {
      this.configurationFileName = "bandera.bogor-conf";
    }
    this.externalDataMapFileName = this.toolConfiguration.getProperty("edu.ksu.cis.projects.bogor.tool.dumpDataMapFileName");
    if ((this.externalDataMapFileName == null) || (this.externalDataMapFileName.length() <= 0)) {
      this.externalDataMapFileName = "externalDataMap.object";
    }
    this.trailFilePrefix = this.toolConfiguration.getProperty("edu.ksu.cis.projects.bogor.tool.trailFilePrefix");
    if ((this.trailFilePrefix == null) || (this.trailFilePrefix.length() <= 0))
      this.trailFilePrefix = "";
  }

  private static void fixProperties(Properties p)
  {
    if ((p != null) && (p.size() > 0)) {
      Iterator pki = p.keySet().iterator();
      while (pki.hasNext()) {
        String key = (String)pki.next();
        String value = p.getProperty(key);
        p.setProperty(key, value.trim());
      }
    }
  }

  public String getConfiguration()
    throws Exception
  {
    ByteArrayOutputStream baos = new ByteArrayOutputStream();
    if (this.toolConfiguration != null) {
      try {
        this.toolConfiguration.store(baos, null);
      }
      catch (IOException ioe)
      {
        throw new Exception("An error occured while creating the configuration.", ioe);
      }

    }

    return baos.toString();
  }

  public void setInputMap(Map inputMap)
    throws Exception
  {
    if (inputMap == null) {
      throw new IllegalArgumentException("The inputMap cannot be null.");
    }
    Object modelObject = inputMap.get("Model");
    if (modelObject == null) {
      throw new IllegalArgumentException("The inputMap did not contain a value for the model (key: Model).");
    }

    if (!(modelObject instanceof System)) {
      throw new IllegalArgumentException("The inputMap contained a value for the model (key: Model) that was not a BIR System.");
    }

    this.model = ((System)modelObject);

    Object configObject = inputMap.get("Config");
    if (configObject == null) {
      throw new IllegalArgumentException("The inputMap did not contain a value for the config (key: Config).");
    }

    if (!(configObject instanceof String)) {
      throw new IllegalArgumentException("The inputMap contained a value for the config (key: Config) that was no a String.");
    }

    String config = (String)configObject;
    if (config.length() > 0) {
      ByteArrayInputStream bais = new ByteArrayInputStream(config.getBytes());
      if (this.inputConfiguration == null)
        this.inputConfiguration = new Properties();
      else {
        this.inputConfiguration.clear();
      }
      this.inputConfiguration.load(bais);
      bais.close();
    }

    Object externalDataMapObject = inputMap.get("ExternalDataMap");
    if ((externalDataMapObject != null) && (externalDataMapObject instanceof Map)) {
      this.externalDataMap.clear();
      this.externalDataMap.putAll((Map)externalDataMapObject);
    }
  }

  public List getInputParameterList()
  {
    List result = new ArrayList();
    int size = inputParameters.length;

    for (int i = 0; i < size; ++i) {
      result.add(inputParameters[i]);
    }

    return result;
  }

  public Map getOutputMap()
  {
    return this.outputMap;
  }

  public List getOutputParameterList()
  {
    List result = new ArrayList();
    int size = outputParameters.length;

    for (int i = 0; i < size; ++i) {
      result.add(outputParameters[i]);
    }

    return result;
  }

  public ToolConfigurationView getToolConfigurationView()
  {
    return null;
  }

  public ToolIconView getToolIconView()
  {
    return null;
  }

  public void quit()
  {
    this.progressManager.terminate();
    this.stopped = true;
  }

  private void reset()
  {
    this.stopped = false;

    if (this.outputMap == null)
      this.outputMap = new HashMap();
    else {
      this.outputMap.clear();
    }

    this.errors = new Errors();
    this.files = new Files();
  }

  private static void serializeDataToFile(Object serializedDataObject, java.io.File file)
    throws IOException
  {
    FileOutputStream fos = new FileOutputStream(file);
    ObjectOutputStream oos = new ObjectOutputStream(fos);
    oos.writeObject(serializedDataObject);
    oos.close();
    fos.close();
  }

  private void dumpExternalDataMap()
    throws IOException
  {
    if (this.externalDataMap == null) return; if (this.externalDataMap.size() < 1) {
      return;
    }
    java.io.File f = new java.io.File(this.externalDataMapFileName);
    if (f.exists()) {
      f.delete();
    }
    boolean created = f.createNewFile();
    if ((created) && (f.canWrite())) {
      serializeDataToFile(this.externalDataMap, f);
      edu.ksu.cis.projects.bogor.tool.results.files.v1.File file = new edu.ksu.cis.projects.bogor.tool.results.files.v1.File();
      file.setId(this.externalDataMapFileName);
      file.setType(FileTypes.DATAMAP);
      file.setLoc(this.externalDataMapFileName);
      this.files.addFile(file);
    }
  }

  public void run()
    throws Exception
  {
    if (this.model == null) {
      throw new IllegalStateException("The BogorTool cannot be run with a null System.");
    }

    reset();

    if (this.dumpConfiguration) {
      dumpConfigurationInformation();
      dumpExternalDataMap();
    }

    String filename = "";
    String counterExampleFileId = "";
    if ((this.trailFilePrefix == null) || (this.trailFilePrefix.length() <= 0)) {
      filename = "./" + this.model.getId() + this.model.hashCode();
      counterExampleFileId = this.model.getId() + this.model.hashCode();
    } else {
      filename = this.trailFilePrefix;
      counterExampleFileId = this.trailFilePrefix;
    }

/*    StringWriter sw = new StringWriter();
    this.pw = new PrintWriter(sw);
*/
    SymbolTable symbolTable = new SymbolTable(filename, this.model);
/*  Checker checker = new Checker();
    checker.check(symbolTable);

    if (symbolTable.getAllErrors().size() > 0)
    {
      Iterator stei = symbolTable.getAllErrors().iterator();
      while (stei.hasNext()) {
        Object o = stei.next();

        String content = "";
        if (o == null)
          continue;
        if (o instanceof FileMessage) {
          FileMessage fm = (FileMessage)o;
          content = "[Line " + fm.getLine() + ", Column " + fm.getColumn() + "] " + fm.getText();
        } else {
          content = o.toString();
        }

        ModelFailure modelFailure = new ModelFailure();
        modelFailure.setType(ModelFailureTypes.INITIALIZATIONERROR);
        modelFailure.setContent(content);
        this.errors.addModelFailure(modelFailure);
        this.pw.println(content);
      }
      this.pw.flush();

      this.outputMap.put("Result", "Errors");
      this.outputMap.put("Print", sw.toString());
      this.outputMap.put("Errors", this.errors);
      return;
    }
*/
    Properties configuration = getCurrentProperties();
    IMessageStore messageStore = Bogor.modelCheck(symbolTable, this.pw, this.progressManager, getBogorConfiguration(), configuration, this.externalDataMap);
    
//    IBogorConfiguration bc = new DefaultBogorConfiguration();
//	bc.initialize(symbolTable, this.progressManager, pw, configuration, this.externalDataMap);
//	ISearcher searcher = bc.getSearcher();
//	searcher.initialize();
//    bc.getSearcher().search();

 /*   this.pw.flush();

    if (this.progressManager.wasMaxDepthReached()) {
      this.outputMap.put("Result", "Warnings");
    }

    if (messageStore.getErrorCount() > 0) {
      this.outputMap.put("Result", "Errors");
      for (int i = 0; i < messageStore.getErrorCount(); ++i) {
        FileMessage fm = messageStore.getError(i);
        ModelFailure modelFailure = new ModelFailure();
        modelFailure.setType(ModelFailureTypes.INITIALIZATIONERROR);
        modelFailure.setContent(fm.toString());
        this.errors.addModelFailure(modelFailure);
      }
    }

    if (this.progressManager.getErrors() > 0)
    {
      this.outputMap.put("Result", "Errors");

      if ("true".equals(configuration.get("edu.ksu.cis.projects.bogor.module.ISearcher.writeTrailFile"))) {
        edu.ksu.cis.projects.bogor.tool.results.files.v1.File counterExampleFile = new edu.ksu.cis.projects.bogor.tool.results.files.v1.File();
        counterExampleFile.setType(FileTypes.COUNTEREXAMPLE);
        counterExampleFile.setLoc(filename + ".bogor-trails");
        counterExampleFile.setId(counterExampleFileId);
        this.files.addFile(counterExampleFile);
      }

    }

    if ((this.progressManager.wasOutOfMemory()) || (this.progressManager.hasIllFormedModel())) {
      this.outputMap.put("Result", "Errors");
    }

    boolean typeCheckingOnly = false;
    String trash = (String)configuration.get("typeCheckingOnly");
    if ((trash == null) || (trash.trim().toLowerCase().equals("false")))
      typeCheckingOnly = false;
    else {
      typeCheckingOnly = true;
    }
    if ((this.progressManager.getErrors() == 0) && (messageStore.getErrorCount() == 0)) {
      if (typeCheckingOnly)
        this.outputMap.put("Result", "TypeChecked");
      else {
        this.outputMap.put("Result", "Verified");
      }

    }

    if (this.stopped) {
      this.outputMap.put("Result", "Stopped");
    }

    assert (this.outputMap.get("Result") != null) : "The result should not be null at this point.";

    this.outputMap.put("Files", this.files);
    this.outputMap.put("Print", sw.toString());
    if ((this.errors != null) && (((this.errors.getCheckerFailureCount() > 0) || (this.errors.getModelFailureCount() > 0) || (this.errors.getPropertyFailureCount() > 0))))
    {
      this.outputMap.put("Errors", this.errors);
    }

    Metrics metrics = createMetrics(this.progressManager);
    this.outputMap.put("Metrics", metrics);*/
  }

  private static Metrics createMetrics(IProgressManager pm)
  {
    Metrics metrics = new Metrics();

    Metric statesMetric = new Metric();
    statesMetric.setId("States");
    statesMetric.setValue(String.valueOf(pm.getStates()));
    metrics.addMetric(statesMetric);

    Metric matchedStatesMetric = new Metric();
    matchedStatesMetric.setId("MatchedStates");
    matchedStatesMetric.setValue(String.valueOf(pm.getMatchedStates()));
    metrics.addMetric(matchedStatesMetric);

    Metric maxDepthMetric = new Metric();
    maxDepthMetric.setId("MaxDepth");
    maxDepthMetric.setValue(String.valueOf(pm.getMaxDepth()));
    metrics.addMetric(maxDepthMetric);

    Metric transitionsMetric = new Metric();
    transitionsMetric.setId("Transitions");
    transitionsMetric.setValue(String.valueOf(pm.getTransitions()));
    metrics.addMetric(transitionsMetric);

    Map metricMap = pm.getMetrics();
    if ((metricMap != null) && (metricMap.size() > 0)) {
      Iterator mmki = metricMap.keySet().iterator();
      while (mmki.hasNext()) {
        String key = (String)mmki.next();
        ReportValue reportValue = (ReportValue)metricMap.get(key);
        String reportValueString = "";
        if (reportValue == null)
          continue;
        if (reportValue instanceof IntReportValue) {
          IntReportValue irv = (IntReportValue)reportValue;
          reportValueString = String.valueOf(irv.getValue());
        } else if (reportValue instanceof FloatReportValue) {
          FloatReportValue frv = (FloatReportValue)reportValue;
          reportValueString = String.valueOf(frv.getValue());
        } else if (reportValue instanceof DoubleReportValue) {
          DoubleReportValue drv = (DoubleReportValue)reportValue;
          reportValueString = String.valueOf(drv.getValue());
        } else if (reportValue instanceof LongReportValue) {
          LongReportValue lrv = (LongReportValue)reportValue;
          reportValueString = String.valueOf(lrv.getValue());
        } else if (reportValue instanceof StringReportValue) {
          StringReportValue srv = (StringReportValue)reportValue;
          reportValueString = String.valueOf(srv.getValue());
        }
        else {
          reportValueString = "Unknown type: " + reportValue.getClass().getName();
        }
        Metric m = new Metric();
        m.setId(key);
        m.setValue(reportValueString);
        metrics.addMetric(m);
      }
    }

    return metrics;
  }

  protected IProgressManager getProgressManager()
  {
    if (this.progressManager == null) {
      initProgressManager();
    }
    return this.progressManager;
  }

  private void initProgressManager()
  {
    this.progressManager = new BogorToolProgressManager(this);
  }

  public IBogorConfiguration getBogorConfiguration()
  {
    if (this.bogorConfiguration == null) {
      initBogorConfiguration();
    }
    return this.bogorConfiguration;
  }

  private void initBogorConfiguration()
  {
    this.bogorConfiguration = new DefaultBogorConfiguration();
  }

  private void dumpConfigurationInformation()
  {
    try
    {
      java.io.File configurationFile = new java.io.File(this.configurationFileName);

      if (configurationFile.exists())
      {
        configurationFile.delete();
      }

      configurationFile.createNewFile();
      OutputStream configurationFileOutputStream = new FileOutputStream(configurationFile);

      Properties configuration = getCurrentProperties();
      if ((configuration != null) && (configuration.size() > 0)) {
        configuration.store(configurationFileOutputStream, "");
        edu.ksu.cis.projects.bogor.tool.results.files.v1.File file = new edu.ksu.cis.projects.bogor.tool.results.files.v1.File();
        file.setId(this.configurationFileName);
        file.setType(FileTypes.CONFIGURATION);
        file.setLoc(this.configurationFileName);
        this.files.addFile(file);
      }
    }
    catch (FileNotFoundException fnfe)
    {
      return;
    }
    catch (IOException ioe) {
      return;
    }
  }

  private Properties getCurrentProperties()
  {
    List configs = new ArrayList(3);
    configs.add(this.defaultConfiguration);
    configs.add(this.inputConfiguration);
    configs.add(this.toolConfiguration);
    Properties configuration = correlateConfigs(configs);
    return configuration;
  }

  public String toString()
  {
    return "BogorTool";
  }

  public void signalUncaughtException(long currentDepth, long time, long transitions)
  {
    PropertyFailure propertyFailure = new PropertyFailure();
    propertyFailure.setType(PropertyFailureTypes.UNCAUGHTEXCEPTION);
    propertyFailure.setDepth(currentDepth);
    propertyFailure.setTransitions(transitions);
    propertyFailure.setTime(time);
    this.errors.addPropertyFailure(propertyFailure);
  }

  public void signalInvalidEndState(long currentDepth, long time, long transitions)
  {
    PropertyFailure propertyFailure = new PropertyFailure();
    propertyFailure.setType(PropertyFailureTypes.INVALIDENDSTATE);
    propertyFailure.setDepth(currentDepth);
    propertyFailure.setTransitions(transitions);
    propertyFailure.setTime(time);
    this.errors.addPropertyFailure(propertyFailure);
  }

  public void signalRangeException(long currentDepth, long time, long transitions)
  {
    ModelFailure modelFailure = new ModelFailure();
    modelFailure.setType(ModelFailureTypes.RANGEEXCEPTION);
    this.errors.addModelFailure(modelFailure);
  }

  public void signalInvariantViolation(long currentDepth, long time, long transitions)
  {
    PropertyFailure propertyFailure = new PropertyFailure();
    propertyFailure.setType(PropertyFailureTypes.INVARIANTVIOLATION);
    propertyFailure.setDepth(currentDepth);
    propertyFailure.setTransitions(transitions);
    propertyFailure.setTime(time);
    this.errors.addPropertyFailure(propertyFailure);
  }

  public void signalExtFailure(long currentDepth, long time, long transitions)
  {
    CheckerFailure checkerFailure = new CheckerFailure();
    checkerFailure.setType(CheckerFailureTypes.EXTENSIONFAILURE);
    this.errors.addCheckerFailure(checkerFailure);
  }

  public void signalAssertionFailure(long currentDepth, long time, long transitions)
  {
    PropertyFailure propertyFailure = new PropertyFailure();
    propertyFailure.setType(PropertyFailureTypes.ASSERTIONVIOLATION);
    propertyFailure.setDepth(currentDepth);
    propertyFailure.setTransitions(transitions);
    propertyFailure.setTime(time);
    this.errors.addPropertyFailure(propertyFailure);
  }

  public void signalMaxDepthReached(long currentDepth, long time, long transitions)
  {
    ModelFailure modelFailure = new ModelFailure();
    modelFailure.setType(ModelFailureTypes.MAXDEPTHREACHED);

    this.errors.addModelFailure(modelFailure);
  }

  public void signalIllFormedModel(long currentDepth, long time, long transitions)
  {
    ModelFailure modelFailure = new ModelFailure();
    modelFailure.setType(ModelFailureTypes.ILLFORMEDMODEL);

    this.errors.addModelFailure(modelFailure);
  }

  public void signalOutOfMemory(long currentDepth, long time, long transitions)
  {
    CheckerFailure checkerFailure = new CheckerFailure();
    checkerFailure.setType(CheckerFailureTypes.OUTOFMEMORY);

    this.errors.addCheckerFailure(checkerFailure);
  }

  public static Properties correlateConfigs(List<Properties> configs)
  {
    Properties p = new Properties();
    if ((configs != null) && (configs.size() > 0)) {
      Set readOnlySet = new HashSet();
      Iterator ci = configs.iterator();
      while (ci.hasNext()) {
        Properties temp = (Properties)ci.next();
        if ((temp != null) && (temp.size() > 0))
        {
          Properties tempClone = new Properties();
          tempClone.putAll(temp);
          Iterator pi = tempClone.keySet().iterator();
          while (pi.hasNext()) {
            String key = (String)pi.next();
            if ((key != null) && (key.length() > 0) && (key.startsWith("por.readOnlyField."))) {
              String s = (String)temp.remove(key);
              readOnlySet.add(s);
            }
          }
          p.putAll(temp);
        }
      }
      if (!(readOnlySet.isEmpty())) {
        int count = 0;
        Iterator rosi = readOnlySet.iterator();
        while (rosi.hasNext()) {
          String c = (String)rosi.next();
          p.put("por.readOnlyField." + (count++), c);
        }
      }
    }
    return p;
  }

  static
  {
    inputParameters = new String[] { "Model", "Config", "ExternalDataMap" };

    outputParameters = new String[] { "Result", "Print", "Files", "Errors", "Metrics" };
  }
}

/* Location:           D:\tool\banderaCLI-1.0a4\lib\bogor\bogorTool.jar
 * Qualified Name:     edu.ksu.cis.projects.bogor.tool.BogorTool
 * Java Class Version: 5 (49.0)
 * JD-Core Version:    0.5.3
 */